import {
    AUTH_ROLE_ADD,
    AUTH_ROLE_DELETE,
    AUTH_ROLE_LIST,
    AUTH_ROLE_UPDATE
} from '@/config/api'
import {
    IAuthRole,
    IAuthRoleDeleteParameter,
    IAuthRoleEditParameter
} from '@/types/auth/role'
import http from '@/utils/http'

export function authRoleList() {
    return http.get<IAuthRole[]>(AUTH_ROLE_LIST)
}

export function authRoleAdd(parameter: IAuthRoleEditParameter) {
    return http.post(AUTH_ROLE_ADD, parameter)
}

export function authRoleUpdate(parameter: IAuthRoleEditParameter) {
    return http.post(AUTH_ROLE_UPDATE, parameter)
}

export function authRoleDelete(parameter: IAuthRoleDeleteParameter) {
    return http.post(AUTH_ROLE_DELETE, parameter)
}
